﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WCFMoneyService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "MoneyLoverService" in code, svc and config file together.
    public class MoneyLoverService : IMoneyLoverService
    {
        MoneyLoverDomainDataContext _db { set; get; }
        public MoneyLoverService()
        {
            _db = new MoneyLoverDomainDataContext();
        }
       public TAIKHOAN CheckLogin(string user, string pass)
        {
            var objdb = _db.TAIKHOANs.Where(p => p.USERNAME.Equals(user) && p.PASS.Equals(pass)).SingleOrDefault();
            return objdb != null ? objdb : null;
        }
    }
}
